home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple WWDC 1996
/
WWDC96_1996 (CD).toast
/
Technology Materials
/
MacOS 8 Resources
/
Developer Tools
/
Mac OS 8 Interfaces & Libraries
/
Interfaces
/
AIncludes
/
Kernel.a
< prev
next >
Wrap
Text File
|
1996-05-01
|
37KB
|
1,336 lines
;
; File: Kernel.a
;
; Contains: Kernel Interfaces
;
; Version: Technology: System 8
; Release: Universal Interfaces 3.0d3 on Copland DR1
;
; Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
;
; Bugs?: If you find a problem with this file, send the file and version
; information (from above) and the problem description to:
;
; Internet: apple.bugs@applelink.apple.com
; AppleLink: APPLE.BUGS
;
;
IF &TYPE('__KERNEL__') = 'UNDEFINED' THEN
__KERNEL__ SET 1
IF &TYPE('__ERRORS__') = 'UNDEFINED' THEN
include 'Errors.a'
ENDIF
IF &TYPE('__MACHINEEXCEPTIONS__') = 'UNDEFINED' THEN
include 'MachineExceptions.a'
ENDIF
IF &TYPE('__TIMING__') = 'UNDEFINED' THEN
include 'Timing.a'
ENDIF
IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
include 'Types.a'
ENDIF
IF FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE THEN
; Kernel basics
; Tasking
; typedef UInt32 ExecutionLevel
kTaskLevel EQU 0
kSoftwareInterruptLevel EQU 1
kAcceptFunctionLevel EQU 2
kKernelLevel EQU 3
kSIHAcceptFunctionLevel EQU 4
kSecondaryInterruptLevel EQU 5
kHardwareInterruptLevel EQU 6
; Memory System basics
LogicalAddressRange RECORD 0
address ds.l 1 ; offset: $0 (0)
count ds.l 1 ; offset: $4 (4)
sizeof EQU * ; size: $8 (8)
ENDR
; typedef struct LogicalAddressRange * LogicalAddressRangePtr
PhysicalAddressRange RECORD 0
address ds.l 1 ; offset: $0 (0)
count ds.l 1 ; offset: $4 (4)
sizeof EQU * ; size: $8 (8)
ENDR
; typedef struct PhysicalAddressRange * PhysicalAddressRangePtr
; For PrepareMemoryForIO and CheckpointIO
; typedef OptionBits IOPreparationOptions
kIOMultipleRanges EQU $00000001
kIOLogicalRanges EQU $00000002
kIOMinimalLogicalMapping EQU $00000004
kIOShareMappingTables EQU $00000008
kIOIsInput EQU $00000010
kIOIsOutput EQU $00000020
kIOCoherentDataPath EQU $00000040
kIOTransferIsLogical EQU $00000080
kIOClientIsUserMode EQU $00000080
; typedef OptionBits IOPreparationState
kIOStateDone EQU $00000001
kInvalidPageAddress EQU -1
AddressRange RECORD 0
base ds.l 1 ; offset: $0 (0)
length ds.l 1 ; offset: $4 (4)
sizeof EQU * ; size: $8 (8)
ENDR
; C's treatment of arrays and array pointers is atypical
LogicalMappingTable RECORD 0
elements ds.l 1
sizeof EQU * ; size: $4 (4)
ENDR
; typedef LogicalMappingTable * LogicalMappingTablePtr
PhysicalMappingTable RECORD 0
elements ds.l 1
sizeof EQU * ; size: $4 (4)
ENDR
; typedef PhysicalMappingTable * PhysicalMappingTablePtr
AddressRangeTable RECORD 0
elements ds.b 1 * AddressRange.sizeof
sizeof EQU * ; size: $8 (8)
ENDR
; typedef AddressRangeTable * AddressRangeTablePtr
MultipleAddressRange RECORD 0
entryCount ds.l 1 ; offset: $0 (0)
rangeTable ds.l 1 ; offset: $4 (4)
sizeof EQU * ; size: $8 (8)
ENDR
;
; Separate C definition so that union has a name. A future version of the interfacer
; tool will allow a name (that gets thrown out in Pascal and Asm).
;
IOPreparationTable RECORD 0
options ds.l 1 ; offset: $0 (0)
state ds.l 1 ; offset: $4 (4)
preparationID ds.l 1 ; offset: $8 (8)
addressSpace ds.l 1 ; offset: $C (12)
granularity ds.l 1 ; offset: $10 (16)
firstPrepared ds.l 1 ; offset: $14 (20)
lengthPrepared ds.l 1 ; offset: $18 (24)
mappingEntryCount ds.l 1 ; offset: $1C (28)
logicalMapping ds.l 1 ; offset: $20 (32)
physicalMapping ds.l 1 ; offset: $24 (36)
range ds AddressRange ; offset: $28 (40)
ORG 40
multipleRanges ds MultipleAddressRange ; offset: $28 (40)
sizeof EQU * ; size: $30 (48)
ENDR
; typedef OptionBits IOCheckpointOptions
kNextIOIsInput EQU $00000001
kNextIOIsOutput EQU $00000002
kMoreIOTransfers EQU $00000004
; For SetProcessorCacheMode
; typedef UInt32 ProcessorCacheMode
kProcessorCacheModeDefault EQU 0
kProcessorCacheModeInhibited EQU 1
kProcessorCacheModeWriteThrough EQU 2
kProcessorCacheModeCopyBack EQU 3
; For GetPageInformation
kPageInformationVersion EQU 1
; typedef UInt32 PageStateInformation
kPageIsProtected EQU $00000001
kPageIsProtectedPrivileged EQU $00000002
kPageIsModified EQU $00000004
kPageIsReferenced EQU $00000008
kPageIsLockedResident EQU $00000010
kPageIsInMemory EQU $00000020
kPageIsShared EQU $00000040
kPageIsWriteThroughCached EQU $00000080
kPageIsCopyBackCached EQU $00000100
kPageIsLocked EQU $00000010 ; Deprecated
kPageIsResident EQU $00000020 ; Deprecated
PageInformation RECORD 0
area ds.l 1 ; offset: $0 (0)
count ds.l 1 ; offset: $4 (4)
information ds.l 1 ; offset: $8 (8) <-- really an array of length one
sizeof EQU * ; size: $C (12)
ENDR
; typedef struct PageInformation * PageInformationPtr
ENDIF
IF FOR_SYSTEM8_PREEMPTIVE THEN
; System Information
kSystemInformationVersion EQU 1
SystemInformation RECORD 0
numPhysicalRAMPages ds.l 1 ; offset: $0 (0)
numFreeRAMPages ds.l 1 ; offset: $4 (4)
numEligibleRAMPages ds.l 1 ; offset: $8 (8)
numResidentRAMPages ds.l 1 ; offset: $C (12)
numInMemoryGlobalPages ds.l 1 ; offset: $10 (16)
numLogicalPages ds.l 1 ; offset: $14 (20)
pageSize ds.l 1 ; offset: $18 (24)
dataCacheBlockSize ds.l 1 ; offset: $1C (28)
processorVersionNumber ds.l 1 ; offset: $20 (32)
numCPUs ds.l 1 ; offset: $24 (36)
systemKernelProcessID ds.l 1 ; offset: $28 (40)
globalAddressSpaceID ds.l 1 ; offset: $2C (44)
dataCacheSize ds.l 1 ; offset: $30 (48)
instructionCacheSize ds.l 1 ; offset: $34 (52)
cachesAreUnified ds.b 1 ; offset: $38 (56)
filler ds.b 3 ; offset: $39 (57)
sizeof EQU * ; size: $3C (60)
ENDR
; typedef struct SystemInformation * SystemInformationPtr
; KernelQueue Related Declarations
; typedef OptionBits KernelQueueOptions
; Event Flag Related Declarations
; typedef UInt32 EventGroupMask
kEventFlagsPerGroup EQU 32
; typedef UInt32 EventFlagOperation
kEventFlagAll EQU 0
kEventFlagAny EQU 1
kEventFlagAllClear EQU 2
kEventFlagAnyClear EQU 3
kEventFlagSharedClear EQU 4
KernelNotification RECORD 0
eventGroup ds.l 1 ; offset: $0 (0)
eventMask ds.l 1 ; offset: $4 (4)
swi ds.l 1 ; offset: $8 (8)
kernelQueue ds.l 1 ; offset: $C (12)
queueP1 ds.l 1 ; offset: $10 (16)
queueP2 ds.l 1 ; offset: $14 (20)
sizeof EQU * ; size: $18 (24)
ENDR
; typedef struct KernelNotification * KernelNotificationPtr
; Task Related Declarations
; typedef OSType KernelProcessName
; typedef OSType TaskName
; typedef UInt32 TaskStorageIndex
; typedef void * TaskStorageValue
; typedef UInt32 TaskRelationship
kTaskOnly EQU 0
kTaskAndChildren EQU 1
kTaskFamily EQU 2
kTaskKernelProcess EQU 3
; typedef OptionBits SetTaskPriorityOptions
kTaskRaisePriorityBy EQU $00000200
kTaskLowerPriorityBy EQU $00000400
kTaskRaisePriorityToAtLeast EQU $00000800
kTaskLowerPriorityToAtMost EQU $00001000
; typedef OptionBits TaskOptions
kTaskIsOrphan EQU $00400000
kTaskIsResident EQU $00004000
; Priorities are used by CreateTask, SetTaskPriority, and AcceptMessage.
; typedef OptionBits TaskPriority
kTaskPriorityMask EQU $0000001F
kTaskPriorityIsAbsolute EQU $00000100
kTaskPriorityIsSymbolic EQU $00002000
kTaskBackgroundPriority EQU $00002001 ; Gets only otherwise idle time
kTaskAppCPUBoundPriority EQU $00002002 ; For CPU bound tasks
kTaskAppNonUIPriority EQU $00002003 ; For general secondary tasks
kTaskAppPriority EQU $00002004 ; Primary tasks
kTaskUIHelperPriority EQU $00002005 ; Toolbox helper tasks
kTaskLowServerPriority EQU $00002006 ; System servers
kTaskServerPriority EQU $00002007 ; System serverss
kTaskHighServerPriority EQU $00002008 ; System servers
kTaskLowDriverPriority EQU $00002009 ; IO Families & plug-ins
kTaskDriverPriority EQU $0000200A ; IO Families & plug-ins
kTaskHighDriverPriority EQU $0000200B ; IO Families & plug-ins
kTaskRealTimePriority1 EQU $0000200C ; Lowest real time priority
kTaskRealTimePriority2 EQU $0000200D
kTaskRealTimePriority3 EQU $0000200E
kTaskRealTimePriority4 EQU $0000200F
kTaskRealTimePriority5 EQU $00002010
kTaskRealTimePriority6 EQU $00002011
kTaskRealTimePriority7 EQU $00002012
kTaskRealTimePriority8 EQU $00002013
kTaskRealTimePriority9 EQU $00002014
kTaskRealTimePriority10 EQU $00002015
kTaskRealTimePriority11 EQU $00002016
kTaskRealTimePriority12 EQU $00002017
kTaskRealTimePriority13 EQU $00002018
kTaskRealTimePriority14 EQU $00002019
kTaskRealTimePriority15 EQU $0000201A
kTaskRealTimePriority16 EQU $0000201B ; Highest real time priority
; typedef OptionBits TerminateOptions
; typedef OSType SchedulerState
kTaskInformationVersion EQU 1
TaskInformation RECORD 0
name ds.l 1 ; offset: $0 (0)
owningKernelProcess ds.l 1 ; offset: $4 (4)
options ds.l 1 ; offset: $8 (8) ; Includes originally specified symbolic priority
priority ds.l 1 ; offset: $C (12) ; Absolute priority
taskState ds.l 1 ; offset: $10 (16)
swiState ds.l 1 ; offset: $14 (20)
isTerminating ds.b 1 ; offset: $18 (24)
reserved2 ds.b 3 ; offset: $19 (25)
softwareInterrupts ds.l 1 ; offset: $1C (28)
stackLimit ds.l 1 ; offset: $20 (32)
stackSize ds.l 1 ; offset: $24 (36)
creationTime ds AbsoluteTime ; offset: $28 (40)
cpuTime ds AbsoluteTime ; offset: $30 (48)
reserved ds.l 1 ; offset: $38 (56)
sizeof EQU * ; size: $3C (60)
ENDR
; typedef struct TaskInformation * TaskInformationPtr
; typedef OptionBits KernelProcessOptions
kKernelProcessIsPrivileged EQU $00000001
kKernelProcessInformationVersion EQU 1
KernelProcessInformation RECORD 0
name ds.l 1 ; offset: $0 (0)
addressSpace ds.l 1 ; offset: $4 (4)
options ds.l 1 ; offset: $8 (8)
sizeof EQU * ; size: $C (12)
ENDR
; typedef struct KernelProcessInformation * KernelProcessInformationPtr
; Timer related declarations
; typedef OptionBits TimerOptions
; Address Space Management related declarations
; General definitions
kNoBackingObjectID EQU 0
; typedef OptionBits AreaOptions
kZeroFill EQU $00000001
kResidentArea EQU $00000002
kSparseArea EQU $00000004
kPlacedArea EQU $00000008
kGlobalArea EQU $00000010
kPhysicallyContiguousArea EQU $00000020
kMassMappedArea EQU $00000040
; typedef OptionBits InterspaceCopyOptions
kCheckSourceUserRights EQU $00000001
kCheckDestinationUserRights EQU $00000002
; typedef UInt32 AreaUsage
kUsageUnknown EQU 0
kUsageRAM EQU 1
kUsageROM EQU 2
kUsageIO EQU 3
kUsageVideoRAM EQU 4
; typedef UInt32 MemoryAccessLevel
kMemoryExcluded EQU 0
kMemoryReadOnly EQU 1
kMemoryReadWrite EQU 2
kMemoryCopyOnWrite EQU 3
kInheritUserAccess EQU 4
kInheritPrivilegedAccess EQU 5
BackingAddress RECORD 0
f ds UInt64
sizeof EQU * ; size: $8 (8)
ENDR
BackingLength RECORD 0
f ds UInt64
sizeof EQU * ; size: $8 (8)
ENDR
; For GetSpaceInformation
kSpaceInformationVersion EQU 1
SpaceInformation RECORD 0
numLogicalPages ds.l 1 ; offset: $0 (0)
numInMemoryPages ds.l 1 ; offset: $4 (4)
numResidentPages ds.l 1 ; offset: $8 (8)
sizeof EQU * ; size: $C (12)
ENDR
; typedef struct SpaceInformation * SpaceInformationPtr
; For GetAreaInformation
kAreaInformationVersion EQU 1
AreaInformation RECORD 0
addressSpace ds.l 1 ; offset: $0 (0)
base ds.l 1 ; offset: $4 (4)
length ds.l 1 ; offset: $8 (8)
userAccessLevel ds.l 1 ; offset: $C (12)
privilegedAccessLevel ds.l 1 ; offset: $10 (16)
usage ds.l 1 ; offset: $14 (20)
backingObject ds.l 1 ; offset: $18 (24)
backingBase ds BackingAddress ; offset: $1C (28)
options ds.l 1 ; offset: $24 (36)
owningKernelProcess ds.l 1 ; offset: $28 (40)
sizeof EQU * ; size: $2C (44)
ENDR
; typedef struct AreaInformation * AreaInformationPtr
; For Memory Reservations
; typedef OptionBits ReservationOptions
kPlacedReservation EQU $00000001
kGlobalReservation EQU $00000002
kGlobalAreaReservation EQU $00000004
; For GetReservationInformation
kReservationInformationVersion EQU 1
ReservationInformation RECORD 0
addressSpace ds.l 1 ; offset: $0 (0)
base ds.l 1 ; offset: $4 (4)
length ds.l 1 ; offset: $8 (8)
options ds.l 1 ; offset: $C (12)
sizeof EQU * ; size: $10 (16)
ENDR
; typedef struct ReservationInformation * ReservationInformationPtr
; For ControlPagingForRange
; typedef UInt32 PageControlOperation
kControlPageMakePageable EQU 1
kControlPageMakeResident EQU 2
kControlPageCommit EQU 3
kControlPageTouch EQU 4
kControlPageReplace EQU 5
kControlPageFlush EQU 6
kControlPageFlushAsync EQU 7
; For ReleaseData
; typedef OptionBits ReleaseDataOptions
kReleaseBackingStore EQU $00000001
; Message related declarations
; typedef UInt32 MessageType
; Kernel Message Types
kAllNonKernelMessageTypes EQU $0FFFFFFF
kAllMessages EQU $FFFFFFFF
; Options for CreatePort
; typedef OptionBits PortOptions
; Options for CreateObject
; typedef OptionBits ObjectOptions
; Options for LockObject
; typedef OptionBits ObjectLockOptions
kLockObjectWithOneMessage EQU $00000001
; Options for SetObjectInformation;
; typedef OptionBits SetObjectOptions
kSetObjectPort EQU $00000002
kSetObjectRefcon EQU $00000004
; Message System Options
; typedef OptionBits SendOptions
kSendTransferKindMask EQU $00000003 ; Set by sender
kSendByChoice EQU $00000000
kSendByReference EQU $00000001
kSendByValue EQU $00000002
kSendIsBuffered EQU $00000003
kSendIsPrivileged EQU $00000008 ; Set by kernel
kSendIsAtomic EQU $00000010 ; Set by sender
kSendPtrsAddressable EQU $00000020 ; Set by kernel
kSendPtrsNeedAccessCheck EQU $00000040 ; Set by kernel
; typedef OptionBits ReceiveOptions
kReceiveNoAddressTranslation EQU $00000002
; typedef OptionBits AcceptOptions
kAcceptFunctionIsResident EQU $00010000
; Message Definition (Given to receiver or acceptor)
MessageControlBlock RECORD 0
message ds.l 1 ; offset: $0 (0)
addressSpace ds.l 1 ; offset: $4 (4)
sendingKernelProcess ds.l 1 ; offset: $8 (8)
sendingTask ds.l 1 ; offset: $C (12)
refcon ds.l 1 ; offset: $10 (16)
options ds.l 1 ; offset: $14 (20)
theType ds.l 1 ; offset: $18 (24)
messageContents ds.l 1 ; offset: $1C (28)
messageContentsSize ds.l 1 ; offset: $20 (32)
replyBuffer ds.l 1 ; offset: $24 (36)
replyBufferSize ds.l 1 ; offset: $28 (40)
currentStatus ds.l 1 ; offset: $2C (44)
reserved ds.l 4 ; offset: $30 (48)
sizeof EQU * ; size: $40 (64)
ENDR
; typedef struct MessageControlBlock * MessageControlBlockPtr
kMessageInformationVersion EQU 1
MessageInformation RECORD 0
object ds.l 1 ; offset: $0 (0)
sendingTask ds.l 1 ; offset: $4 (4)
sendingKernelProcess ds.l 1 ; offset: $8 (8)
sizeof EQU * ; size: $C (12)
ENDR
; typedef struct MessageInformation * MessageInformationPtr
; Message Accept proc used to receive a message
; Version for GetPortInformation
kPortInformationVersion EQU 1
; Buffer used to return message port information
PortInformation RECORD 0
owningKernelProcess ds.l 1 ; offset: $0 (0)
acceptProc ds.l 1 ; offset: $4 (4)
acceptHandler ds.l 1 ; offset: $8 (8)
theAcceptOptions ds.l 1 ; offset: $C (12)
acceptRefcon ds.l 1 ; offset: $10 (16)
objectCount ds.l 1 ; offset: $14 (20)
pendingReceives ds.l 1 ; offset: $18 (24)
pendingSends ds.l 1 ; offset: $1C (28)
pendingReplies ds.l 1 ; offset: $20 (32)
transactionCount ds.l 1 ; offset: $24 (36)
blockedAsyncSenders ds.l 1 ; offset: $28 (40)
blockedAsyncReceivers ds.l 1 ; offset: $2C (44)
sizeof EQU * ; size: $30 (48)
ENDR
; typedef struct PortInformation * PortInformationPtr
ENDIF
IF FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE THEN
; Tasks
;
; extern ExecutionLevel CurrentExecutionLevel(void )
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION CurrentExecutionLevel
ENDIF
;
; extern TaskID CurrentTaskID(void )
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION CurrentTaskID
ENDIF
;
; extern OSStatus DelayFor(Duration delayDuration)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION DelayFor
ENDIF
;
; extern Boolean InPrivilegedMode(void )
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION InPrivilegedMode
ENDIF
; Software Interrupts
;
; extern OSStatus CreateSoftwareInterrupt(SoftwareInterruptHandler handler, TaskID task, void *p1, Boolean persistent, SoftwareInterruptID *theSoftwareInterrupt)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION CreateSoftwareInterrupt
ENDIF
;
; extern OSStatus SendSoftwareInterrupt(SoftwareInterruptID theSoftwareInterrupt, void *p2)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION SendSoftwareInterrupt
ENDIF
;
; extern OSStatus DeleteSoftwareInterrupt(SoftwareInterruptID theSoftwareInterrupt)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION DeleteSoftwareInterrupt
ENDIF
;
; extern void DisableSoftwareInterrupts(void )
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION DisableSoftwareInterrupts
ENDIF
;
; extern void EnableSoftwareInterrupts(void )
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION EnableSoftwareInterrupts
ENDIF
;
; extern Boolean InSoftwareInterruptHandler(void )
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION InSoftwareInterruptHandler
ENDIF
; Completion Routines
;
; extern void DisableCompletionRoutines(void )
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION DisableCompletionRoutines
ENDIF
;
; extern void EnableCompletionRoutines(void )
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION EnableCompletionRoutines
ENDIF
; Secondary Interrupts
;
; extern OSStatus CallSecondaryInterruptHandler2(SecondaryInterruptHandler2 theHandler, ExceptionHandler exceptionHandler, void *p1, void *p2)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION CallSecondaryInterruptHandler2
ENDIF
;
; extern OSStatus QueueSecondaryInterruptHandler(SecondaryInterruptHandler2 theHandler, ExceptionHandler exceptionHandler, void *p1, void *p2)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION QueueSecondaryInterruptHandler
ENDIF
; Timers
;
; extern OSStatus SetInterruptTimer(const AbsoluteTime *expirationTime, SecondaryInterruptHandler2 handler, void *p1, TimerID *theTimer)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION SetInterruptTimer
ENDIF
;
; extern OSStatus CancelTimer(TimerID theTimer, AbsoluteTime *timeRemaining)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION CancelTimer
ENDIF
; IO related Operations
;
; extern OSStatus PrepareMemoryForIO(IOPreparationTable *theIOPreparationTable)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION PrepareMemoryForIO
ENDIF
;
; extern OSStatus CheckpointIO(IOPreparationID theIOPreparation, IOCheckpointOptions options)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION CheckpointIO
ENDIF
; Memory Operations
;
; extern OSStatus GetPageInformation(AddressSpaceID addressSpace, ConstLogicalAddress base, ItemCount requestedPages, PBVersion version, PageInformation *thePageInfo)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION GetPageInformation
ENDIF
; Processor Cache Related
;
; extern OSStatus SetProcessorCacheMode(AddressSpaceID addressSpace, ConstLogicalAddress base, ByteCount length, ProcessorCacheMode cacheMode)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION SetProcessorCacheMode
ENDIF
ENDIF
IF FOR_SYSTEM8_PREEMPTIVE THEN
; Queues
;
; extern OSStatus CreateKernelQueue(KernelQueueOptions options, KernelQueueID *theQueue)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION CreateKernelQueue
ENDIF
;
; extern OSStatus DeleteKernelQueue(KernelQueueID theQueue)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION DeleteKernelQueue
ENDIF
;
; extern OSStatus WaitOnKernelQueue(KernelQueueID theQueue, void **p1, void **p2, void **p3, Duration timeOut)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION WaitOnKernelQueue
ENDIF
;
; extern OSStatus NotifyKernelQueue(KernelQueueID theQueue, void *p1, void *p2, void *p3)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION NotifyKernelQueue
ENDIF
;
; extern OSStatus AdjustKernelQueueSIHLimit(KernelQueueID theQueue, SInt32 amount, ItemCount *newLimit)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION AdjustKernelQueueSIHLimit
ENDIF
; Event Flag Related Operations
;
; extern OSStatus CreateEventGroup(EventGroupID *theGroup)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION CreateEventGroup
ENDIF
;
; extern OSStatus DeleteEventGroup(EventGroupID theGroup)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION DeleteEventGroup
ENDIF
;
; extern OSStatus SetEvents(EventGroupID theGroup, EventGroupMask mask)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION SetEvents
ENDIF
;
; extern OSStatus ClearEvents(EventGroupID theGroup, EventGroupMask mask)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION ClearEvents
ENDIF
;
; extern OSStatus ReadEvents(EventGroupID theGroup, EventGroupMask *currentValue)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION ReadEvents
ENDIF
;
; extern OSStatus WaitForEvents(EventGroupID theGroup, Duration timeOut, EventGroupMask mask, EventFlagOperation operation, EventGroupMask *value)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION WaitForEvents
ENDIF
; KernelProcess Related Operations
;
; extern OSStatus CreateKernelProcess(KernelProcessName name, AddressSpaceID addressSpace, KernelProcessOptions options, KernelProcessID *theKernelProcess)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION CreateKernelProcess
ENDIF
;
; extern OSStatus ExitKernelProcess(TerminateOptions options, OSStatus exitStatus)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION ExitKernelProcess
ENDIF
;
; extern OSStatus DeleteKernelProcess(KernelProcessID theKernelProcess, TerminateOptions options, OSStatus deleteStatus)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION DeleteKernelProcess
ENDIF
;
; extern OSStatus GetKernelProcessesInSystem(ItemCount requestedKernelProcesses, ItemCount *totalKernelProcesses, KernelProcessID *theKernelProcesses)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION GetKernelProcessesInSystem
ENDIF
;
; extern OSStatus GetKernelProcessInformation(KernelProcessID theKernelProcess, PBVersion version, KernelProcessInformation *kernelProcessInfo)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION GetKernelProcessInformation
ENDIF
;
; extern KernelProcessID CurrentKernelProcessID(void )
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION CurrentKernelProcessID
ENDIF
; Task Related Operations
;
; extern OSStatus CreateTask(TaskName name, KernelProcessID owningKernelProcess, TaskProc entryPoint, void *parameter, LogicalAddress stackBase, ByteCount stackSize, const KernelNotification *notification, TaskOptions options, TaskID *theTask)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION CreateTask
ENDIF
;
; extern OSStatus ExitTask(TerminateOptions options, OSStatus exitStatus)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION ExitTask
ENDIF
;
; extern OSStatus TerminateTask(TaskID theTask, TaskRelationship scope, TerminateOptions options, OSStatus terminateStatus)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION TerminateTask
ENDIF
;
; extern ByteCount RemainingStackSpace(void )
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION RemainingStackSpace
ENDIF
;
; extern OSStatus GetTaskInformation(TaskID theTask, PBVersion version, TaskInformation *taskInfo)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION GetTaskInformation
ENDIF
;
; extern OSStatus SetTaskPriority(TaskID theTask, TaskRelationship scope, SetTaskPriorityOptions options)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION SetTaskPriority
ENDIF
;
; extern OSStatus GetTasksInKernelProcess(KernelProcessID kernelProcess, ItemCount requestedTasks, ItemCount *totalTasks, TaskID *theTasks)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION GetTasksInKernelProcess
ENDIF
;
; extern OSStatus AllocateTaskStorageIndex(TaskStorageIndex *theIndex)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION AllocateTaskStorageIndex
ENDIF
;
; extern OSStatus DeallocateTaskStorageIndex(TaskStorageIndex theIndex)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION DeallocateTaskStorageIndex
ENDIF
;
; extern OSStatus SetTaskStorageValue(TaskStorageIndex theIndex, TaskStorageValue newValue)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION SetTaskStorageValue
ENDIF
;
; extern TaskStorageValue GetTaskStorageValue(TaskStorageIndex theIndex)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION GetTaskStorageValue
ENDIF
; Secondary Interrupt Handlers
;
; extern OSStatus AdjustSecondaryInterruptHandlerLimit(SInt32 amount, ItemCount *newLimit)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION AdjustSecondaryInterruptHandlerLimit
ENDIF
; Timers
;
; extern OSStatus DelayUntil(const AbsoluteTime *expirationTime)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION DelayUntil
ENDIF
;
; extern OSStatus SetTimer(const AbsoluteTime *expirationTime, const KernelNotification *notification, TimerOptions options, TimerID *theTimer)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION SetTimer
ENDIF
;
; extern OSStatus ResetTimer(TimerID theTimer, const AbsoluteTime *expirationTime, const KernelNotification *notification, TimerOptions options)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION ResetTimer
ENDIF
;
; extern OSStatus AdjustInterruptTimerSIHLimit(SInt32 amount, ItemCount *newLimit)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION AdjustInterruptTimerSIHLimit
ENDIF
; Address Space Management
;
; extern OSStatus CreateAddressSpace(AddressSpaceID *theAddressSpace)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION CreateAddressSpace
ENDIF
;
; extern OSStatus DeleteAddressSpace(AddressSpaceID theAddressSpace)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION DeleteAddressSpace
ENDIF
;
; extern OSStatus GetAddressSpacesInSystem(ItemCount requestedAddressSpaces, ItemCount *totalAddressSpaces, AddressSpaceID *theAddressSpaces)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION GetAddressSpacesInSystem
ENDIF
;
; extern OSStatus GetSpaceInformation(AddressSpaceID theAddressSpace, PBVersion version, SpaceInformation *spaceInfo)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION GetSpaceInformation
ENDIF
;
; extern OSStatus InterspaceBlockCopy(AddressSpaceID sourceAddressSpace, AddressSpaceID targetAddressSpace, ConstLogicalAddress sourceBase, LogicalAddress targetBase, ByteCount length, InterspaceCopyOptions options)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION InterspaceBlockCopy
ENDIF
;
; extern OSStatus CheckUserAccess(ConstLogicalAddress address, ByteCount length, MemoryReferenceKind referenceKind)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION CheckUserAccess
ENDIF
;
; extern AddressSpaceID CurrentAddressSpaceID(void )
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION CurrentAddressSpaceID
ENDIF
; Area Management
;
; extern OSStatus CreateArea(KernelProcessID owningKernelProcess, BackingObjectID backingObject, const BackingAddress *backingBase, ByteCount backingLength, MemoryAccessLevel userAccessLevel, MemoryAccessLevel privilegedAccessLevel, ByteCount guardLength, AreaOptions options, LogicalAddress *areaBase, AreaID *theArea)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION CreateArea
ENDIF
;
; extern OSStatus CreateAreaForRange(KernelProcessID owningKernelProcess, AddressSpaceID otherSpace, ConstLogicalAddress otherBase, ByteCount length, MemoryAccessLevel userAccessLevel, MemoryAccessLevel privilegedAccessLevel, ByteCount guardLength, AreaOptions options, LogicalAddress *areaBase, AreaID *theArea)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION CreateAreaForRange
ENDIF
;
; extern OSStatus DeleteArea(AreaID theArea)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION DeleteArea
ENDIF
;
; extern OSStatus GetAreaInformation(AreaID theArea, PBVersion version, AreaInformation *areaInfo)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION GetAreaInformation
ENDIF
;
; extern OSStatus GetAreaFromAddress(AddressSpaceID addressSpace, ConstLogicalAddress address, AreaID *theArea)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION GetAreaFromAddress
ENDIF
;
; extern OSStatus GetAreasInAddressSpace(AddressSpaceID addressSpace, ItemCount requestedAreas, ItemCount *totalAreas, AreaID *theAreas)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION GetAreasInAddressSpace
ENDIF
;
; extern OSStatus SetAreaAccess(AreaID theArea, MemoryAccessLevel userAccessLevel, MemoryAccessLevel privilegedAccessLevel)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION SetAreaAccess
ENDIF
;
; extern OSStatus SetAreaBackingBase(AreaID theArea, const BackingAddress *backingBase)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION SetAreaBackingBase
ENDIF
;
; extern OSStatus CreateAreaReservation(KernelProcessID owningKernelProcess, LogicalAddress *reservationBase, ByteCount length, ReservationOptions options, AreaReservationID *theReservation)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION CreateAreaReservation
ENDIF
;
; extern OSStatus DeleteAreaReservation(AreaReservationID theReservation)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION DeleteAreaReservation
ENDIF
;
; extern OSStatus GetReservationInformation(AreaReservationID theReservation, PBVersion version, ReservationInformation *reservationInfo)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION GetReservationInformation
ENDIF
;
; extern OSStatus GetReservationsInAddressSpace(AddressSpaceID addressSpace, ItemCount requestedReservations, ItemCount *totalReservations, AreaReservationID *theReservations)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION GetReservationsInAddressSpace
ENDIF
; Processor Cache Related
;
; extern OSStatus DataToCode(AddressSpaceID addressSpace, ConstLogicalAddress base, ByteCount length)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION DataToCode
ENDIF
;
; extern OSStatus FlushRange(AddressSpaceID addressSpace, ConstLogicalAddress base, ByteCount length)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION FlushRange
ENDIF
; Paging control operations
;
; extern OSStatus ControlPagingForRange(AddressSpaceID addressSpace, ConstLogicalAddress base, ByteCount length, PageControlOperation operation)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION ControlPagingForRange
ENDIF
;
; extern OSStatus ReleaseData(AddressSpaceID addressSpace, ConstLogicalAddress base, ByteCount length, ReleaseDataOptions options)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION ReleaseData
ENDIF
; Message Port Management
;
; extern OSStatus CreatePort(PortOptions options, PortID *thePort)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION CreatePort
ENDIF
;
; extern OSStatus DeletePort(PortID thePort)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION DeletePort
ENDIF
;
; extern OSStatus GetPortInformation(PortID thePort, PBVersion version, PortInformation *portInfo)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION GetPortInformation
ENDIF
;
; extern OSStatus GetPortsInSystem(ItemCount requestedPorts, ItemCount *totalPorts, PortID *thePorts)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION GetPortsInSystem
ENDIF
; Message Object Management
;
; extern OSStatus CreateObject(PortID port, void *refcon, ObjectOptions options, ObjectID *theObject)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION CreateObject
ENDIF
;
; extern OSStatus DeleteObject(ObjectID theObject)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION DeleteObject
ENDIF
;
; extern OSStatus LockObject(ObjectID theObject, ObjectLockOptions options, Duration timeOut)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION LockObject
ENDIF
;
; extern OSStatus UnlockObject(ObjectID theObject)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION UnlockObject
ENDIF
;
; extern OSStatus GetObjectInformation(ObjectID theObject, PortID *port, void **refcon)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION GetObjectInformation
ENDIF
;
; extern OSStatus SetObjectInformation(ObjectID theObject, SetObjectOptions options, PortID port, void *refcon)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION SetObjectInformation
ENDIF
;
; extern OSStatus GetObjectsInPort(PortID port, ItemCount requestedObjects, ItemCount *totalObjects, ObjectID *theObjects)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION GetObjectsInPort
ENDIF
; Message Transaction Operations
;
; extern OSStatus SendMessageSync(ObjectID object, MessageType theType, ConstLogicalAddress messageContents, ByteCount messageContentsSize, LogicalAddress replyBuffer, ByteCount *replyBufferSize, SendOptions options, Duration timeOut)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION SendMessageSync
ENDIF
;
; extern OSStatus SendMessageAsync(ObjectID object, MessageType theType, ConstLogicalAddress messageContents, ByteCount messageContentsSize, LogicalAddress replyBuffer, ByteCount replyBufferSize, SendOptions options, const KernelNotification *notification, ByteCount *replySize, MessageID *theMessage)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION SendMessageAsync
ENDIF
;
; extern OSStatus AcceptMessage(PortID port, MessageType theTypes, MessageAcceptProc acceptProc, ExceptionHandler theExceptionHandler, AcceptOptions options, void *acceptRefcon)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION AcceptMessage
ENDIF
;
; extern OSStatus ReceiveMessageSync(PortID port, MessageType theTypes, MessageControlBlock *theControlBlock, LogicalAddress buffer, ByteCount bufferSize, ReceiveOptions options, Duration timeOut)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION ReceiveMessageSync
ENDIF
;
; extern OSStatus ReceiveMessageAsync(PortID port, MessageType theTypes, MessageControlBlock *theControlBlock, LogicalAddress buffer, ByteCount bufferSize, ReceiveOptions options, const KernelNotification *notification, ReceiveID *theReceive)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION ReceiveMessageAsync
ENDIF
;
; extern OSStatus ReplyToMessage(MessageID theMessage, OSStatus status, ConstLogicalAddress replyBuffer, ByteCount replyBufferSize)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION ReplyToMessage
ENDIF
;
; extern OSStatus ReplyToMessageAndReceive(MessageID theMessage, OSStatus status, ConstLogicalAddress replyBuffer, ByteCount replyBufferSize, PortID port, MessageType theTypes, MessageControlBlock *theControlBlock, LogicalAddress receiveBuffer, ByteCount receiveBufferSize, ReceiveOptions options, Duration timeOut)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION ReplyToMessageAndReceive
ENDIF
; Miscellaneous Messaging operations
;
; extern OSStatus CancelAsyncSend(MessageID theMessage)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION CancelAsyncSend
ENDIF
;
; extern OSStatus CancelAsyncReceive(ReceiveID theReceive)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION CancelAsyncReceive
ENDIF
;
; extern OSStatus GetMessageInformation(MessageID theMessage, PBVersion version, MessageInformation *messageInfo)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION GetMessageInformation
ENDIF
; Miscellaneous System operations
;
; extern OSStatus GetSystemInformation(PBVersion version, SystemInformation *systemInfo)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION GetSystemInformation
ENDIF
; Notifications
;
; extern OSStatus DeliverKernelNotification(const KernelNotification *notification, OSStatus status)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION DeliverKernelNotification
ENDIF
ENDIF
IF FOR_SYSTEM8_PREEMPTIVE THEN
; These are defined in Memory for System 7
;
; pascal void BlockMove(const void *srcPtr, void *destPtr, long byteCount)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION BlockMove
ENDIF
;
; pascal void BlockMoveData(const void *srcPtr, void *destPtr, long byteCount)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION BlockMoveData
ENDIF
;
; extern void BlockMoveUncached(const void *srcPtr, void *destPtr, long byteCount)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION BlockMoveUncached
ENDIF
;
; extern void BlockMoveDataUncached(const void *srcPtr, void *destPtr, long byteCount)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION BlockMoveDataUncached
ENDIF
;
; extern void BlockZero(void *destPtr, long byteCount)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION BlockZero
ENDIF
;
; extern void BlockZeroUncached(void *destPtr, long byteCount)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION BlockZeroUncached
ENDIF
ENDIF
ENDIF ; __KERNEL__